home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / dos / secdr13d / secdrv.doc < prev    next >
Text File  |  1994-04-25  |  63KB  |  1,043 lines

  1. SecureDrive V1.3d Documentation                                             |
  2. Edgar Swank <edgar@spectrx.sbay.org>                                        |
  3.  
  4. This is a maintenance release of SecureDrive 1.3a.  It mainly fixes
  5. reported problems and has minimal new function.  See files BUGS13.DOC
  6. and BUGS13A.doc.
  7.  
  8. A prototype SecureDrive Version 1.3b was sent to a few people for
  9. testing. To avoid confusion, I'm skipping 1.3b for "official"
  10. releases. Similarly, a version 1.3c was released a short time ago,
  11. which did not work with 2M13 as it claimed to do.
  12.  
  13. The only visible functional change from 1.3 to 1.3A is the appearance
  14. of msg
  15.  
  16.    Check bytes in Disk x: Boot Sector need updating from 1.3 to
  17.    1.1/1.3A. Proceed?
  18.  
  19. which will be issued by both LOGIN and CRYPTDSK when they attempt to
  20. verify a passphrase on a hard disk or diskette encrypted by version
  21. 1.3 CRYPTDSK operating in version 1.1 compatability mode.  This
  22. corrects the error in computing the check bytes used to verify the
  23. passphrase and updates the check bytes to the correct 1.1 value and
  24. WRITES back the boot sector. Note that once this update has taken
  25. place, this disk cannot be decrypted by release 1.3 anymore.
  26.  
  27. The major change to 1.3d from 1.3a is the change of location for the
  28. SecureDrive CryptFlag in the boot record and addition of parameters
  29. /UCFO and /RCF.
  30.  
  31. Releases 1.3 and 1.3d of Secure Drive are based on releases 1.0 and
  32. 1.1, mostly written by
  33.  
  34.   Mike Ingle <mikeingle@delphi.com>
  35.  
  36. and version 1.2, with significant new code by myself.
  37.  
  38. The code which we wrote is not copyrighted, but the program contains GNU
  39. Copylefted code, and therefore may be freely distributed under the terms of
  40. the GNU General Public Licence. See file COPYING for legalese.
  41.  
  42. SecureDrive V1.1 Changes from V1.0
  43.  
  44. * Two-drives bug fixed. V1.0 would get the drives out of order if you had
  45.   two physical hard drives. V1.1 fixes this problem.
  46.  
  47. * One-step passphrase change. Instead of decrypting and re-encrypting, you
  48.   can change the passphrase in one step with CRYPTDSK.
  49.  
  50. * Improved hashing algorithm. V1.0 used a simple MD5 of the passphrase to
  51.   produce the encryption key. This allowed an attacker to test possible
  52.   passphrases quickly. V1.1 iterates the hash 2048 times to slow down a
  53.   passphrase search.
  54.  
  55.     Because of the new passphrase hashing algorithm, V1.1 users will
  56.     need to decrypt your disk with V1.0 and re-encrypt with V1.1 to
  57.     upgrade.  The new algorithm produces a different IDEA key for the
  58.     same passphrase.
  59.  
  60.     This may have been unclear in the previous version:  V1.0 and V1.1
  61.     encrypt one hard drive partition at a time.  LOGIN /S will not
  62.     protect more than one partition.  If you log in to a second
  63.     partition, the first one will not be accessible, and will not be
  64.     protected from writes.
  65.  
  66. All references to MD5 refer to:
  67. RSA Data Security, Inc. MD5 Message-Digest Algorithm
  68. (C) 1990, RSA Data Security
  69.  
  70. The IDEA(tm) block cipher is covered by a patent held by ETH and a Swiss
  71. company called Ascom-Tech AG.  The Swiss patent number is PCT/CH91/00117.
  72. International patents are pending. IDEA(tm) is a trademark of Ascom-Tech AG.
  73. There is no license fee required for noncommercial use. Commercial users
  74. may obtain licensing details from:
  75.  
  76.     Dieter Profos, Ascom Tech AG, Solothurn Lab, Postfach 151, 4502
  77.     Solothurn, Switzerland, Tel +41 65 242885, Fax +41 65 235761.
  78.  
  79. Ascom IDEA patents:
  80.  
  81. US patent 5,214,703 granted May 25, 1993.
  82. EP Patent EP 0 482 154 B1 granted June 30, 1993.
  83. JP Patent pending
  84.  
  85. Use this software at your own risk!
  86.  
  87. Send all comments and bug reports to <edgar@spectrx.sbay.org>.              |
  88.  
  89. Changes for version 1.2 are highlighted by "|" at the right margin.         |
  90. Changes for version 1.3 are highlighted by "+" at the right margin.         +
  91.  
  92. Many people have sensitive or confidential data on their personal computers.
  93. Controlling access to this data can be a problem. PC's, and laptops in
  94. particular, are highly vulnerable to theft or unauthorized use. Encryption
  95. is the most secure means of protection, but is often cumbersome to use. The
  96. user must decrypt a file, work with it, encrypt it, and then wipe the
  97. plaintext. If encryption were easy, many more people would use it.
  98. SecureDrive is a step in this direction. SecureDrive automatically stores
  99. sensitive data on your DOS/Windows system in encrypted form.
  100.  
  101. SecureDrive V1.3 allows you to create up to four encrypted partitions       +
  102. on your hard drive(s).  It also allows you to encrypt floppy disks.
  103. Encrypted partitions and disks become fully accessible when the TSR is
  104. loaded and the proper passphrase entered.  The TSR takes only 2.7K of       +
  105. RAM, and can be loaded high.  Encryption is performed at the sector
  106. level and is completely transparent to the application program.
  107. Everything on the disk or partitions except the boot sector is
  108. encrypted.  Encrypted floppy disks can be freely interchanged with
  109. unencrypted ones.  Disks and partitions can be decrypted and returned
  110. to normal at any time.
  111.  
  112. SecureDrive uses the IDEA cipher in CFB mode for maximum data
  113. security.  The MD5 hash function is used to convert the user's
  114. passphrase into a 128-bit IDEA key.  The disk serial number, and track
  115. and sector numbers are used as part of the initialization to make each
  116. sector unique.
  117.  
  118. SecureDrive is made up of four program files.  SECTSR is the                +
  119. memory-resident driver.  CRYPTDSK is used to encrypt and decrypt
  120. floppy disks and hard drive partitions.  LOGIN is used to unlock
  121. encrypted disks and partitions by loading the passphrase and disk
  122. parameters into the resident module. FPART is a utility for finding         +
  123. starting cylinder & head numbers for partitions.
  124.  
  125. Getting started instructions:
  126.  
  127. If you only have one hard drive partition (C:), you will have to
  128. repartition your hard drive if you want an encrypted partition.  You
  129. can use encrypted floppies without changing your hard drive.  You
  130. should create a partition(s) large enough to hold all of your
  131. sensitive data.  For this example, assume the partition is (D:).  Put
  132. SECTSR, CRYPTDSK, LOGIN, and FPART in a directory which is in your          +
  133. PATH.  (Not on the soon-to-be encrypted drive, of course!)
  134.  
  135. Normally re-partitioning a hard drive with FDISK destroys all the data
  136. on it, so you would have to back up all your data beforehand.  But if
  137. you only have one partition now, there is a utility
  138.  
  139. FIPS09.ZIP    86014  01-11-94  Nondestructive hard disk
  140.                                partition split util.
  141.  
  142. available from the GARBO archive and possibly elsewhere that claims
  143. to be able to split your first partition without data loss.
  144.  
  145. Put in your AUTOEXEC.BAT, before the loading of any disk cache:
  146.  
  147.   SECTSR
  148.   LOGIN D: /S (assuming drive D:)
  149.   LOGIN E: /S (and so on for each to-be-encrypted partition, up to four)    +
  150.  
  151. This will load the TSR and put encrypted disk partitions in "safe mode",    +
  152. preventing accidental access and damage to the partitions after they are
  153. encrypted.  Reboot the system to make the changes take effect.
  154.  
  155. You can also use a form of LOGIN                                            +
  156.  
  157.  LOGIN drive cylinder head  /S                                              +
  158.  
  159. in cases where LOGIN can't find the partition from the DOS disk             +
  160. letter. This can happen in configurations with more than two physical       +
  161. disks or where special disk drivers are used. You can use the FPART         +
  162. utility to scan physical drive "drive", which are numbers starting          +
  163. from zero, and locate the proper numbers for "cylinder" and "head".         +
  164.  
  165. Actually, before the partitions are encrypted with CRYPTDSK, LOGIN /S       +
  166. will return a warning message that the partitions are not encrypted,        +
  167. but, as of version 1.3, CRYPTDSK uses SECTSR to protect the drive           +
  168. while it is being encrypted and until the next boot. This is a change       +
  169. from previous versions. V1.0 to V1.2 would not operate on hard disk         +
  170. partitions while SECTSR was in memory.                                      +
  171.  
  172. One purpose of having multiple encrypted hard disk partitions is so         +
  173. that up to four users (perhaps members of a family) can each have           +
  174. their own encrypted partition with its own unique passphrase. This          +
  175. allows up to four users to have privacy from each other, even if they all   +
  176. use the same PC and physical hard disk(s).                                  +
  177.  
  178. The partition can have data on it, or it can be empty.  Run CRYPTDSK
  179. and select the drive letter.  Enter a passphrase.  CRYPTDSK will now
  180. encrypt the partition.  It will skip bad sectors.
  181.  
  182. Repeat this for each hard disk partition.  If different users are           +
  183. assigned to different partitions, let each of them run CRYPTDSK and         +
  184. enter his own unique passphrase.                                            +
  185.  
  186. Now type
  187.  
  188.   LOGIN D: (again, assuming drive D:)
  189.  
  190. and enter your passphrase. Your encrypted drive is now accessible.
  191.  
  192. To use an encrypted floppy, use CRYPTDSK to encrypt the floppy. Then run
  193.  
  194.   LOGIN /F
  195.  
  196. and enter the passphrase. The encrypted floppy is now accessible. If you
  197. entered the wrong passphrase, access will fail with a drive not ready error.
  198.  
  199. As of V1.3, LOGIN will ask you to verify your floppy disk passphrase        +
  200. by inserting an encrypted floppy disk into either the A:  or B:             +
  201. drive.  You are given the option to bypass the verification.                +
  202.  
  203. All versions of LOGIN always verify passphrases for hard disk
  204. partitions.
  205.  
  206. As of Version 1.2, you may use an operand /PGP with LOGIN, either           |
  207. by itself, or with either operand above. By itself,                         |
  208.  
  209.   LOGIN /PGP                                                                |
  210.  
  211. will prompt for a passphrase and set the PGPPASS environment variable       |
  212. with whatever is entered.  As of version 1.3, you can use this form to      +
  213. erase PGPPASS by just pressing Enter (entering a null passphrase) at        +
  214. the prompt.  This accomplishes the same thing as                            +
  215.  
  216.  LOGIN /C /PGP                                                              +
  217.  
  218. described below, but -without- clearing the SecureDrive keys in             +
  219. SECTSR. Also, LOGIN /PGP can be run without SECTSR in memory,               +
  220. so it's a good way to set PGPPASS (no echo) even when you're not            +
  221. using encrypted disks.                                                      +
  222.  
  223. If PGPPASS is already set then
  224.  
  225.   LOGIN D: /PGP                                                             |
  226.  
  227. or                                                                          |
  228.  
  229.   LOGIN /F /PGP                                                             |
  230.  
  231. will use whatever PGPPASS is set to as the passphrase.  For the hard        |
  232. disk partition (and optionally for floppies), LOGIN will test the           +
  233. PGPPASS passphrase.  If it is incorrect, then it will prompt you for        |
  234. another passphrase.                                                         |
  235.  
  236.  
  237. If PGPPASS is NOT set when these forms of LOGIN are used, than a passphrase |
  238. is prompted for AND PGPPASS is set to this passphrase.                      |
  239.  
  240. The purpose of these changes is to allow you to enter a single passphrase   |
  241. only once per boot IF you choose to use the same passphrase for your PGP    |
  242. secret key, your SecureDrive encrypted hard disk partition, and SecureDrive |
  243. encrypted floppies.                                                         |
  244.  
  245. Compatability with Previous Versions:                                       +
  246.  
  247. As you read above, due to use of a more complex hashing algorithm,          +
  248. passphrases entered in Version 1.1 are not compatible with those            +
  249. entered in version 1.0 (and 1.2) and vice versa, because the same           +
  250. passphrases will produce different 128-bit IDEA keys.  Mike Ingle made      +
  251. this change to slow down brute force "dictionary" attacks.                  +
  252.  
  253. As you read above, to switch to Version 1.1 from 1.0, you have to           +
  254. decrypt your hard disk partition and all your encrypted floppies            +
  255. (maybe hundreds of them!)  with CRYPTDSK 1.0 and then re-encrypt with       +
  256. CRYPTDSK 1.1.  Also, with Version 1.1, there is a very noticeable           +
  257. delay (1 or 2 seconds on my normally quick 386/SX 16) to enter and/or       +
  258. verify a passphrase.                                                        +
  259.  
  260. I (Edgar Swank) respectfully disagree with Mike on the value of this        +
  261. "feature."  In my opinion (you may disagree) if you have a good             +
  262. passphrase, this change is not necessary; and it is insufficient to         +
  263. protect a poor passphrase.  The security "exposure" of version 1.0          +
  264. (and 1.2) relative to 1.1 can be more than made up for by adding one        +
  265. word (randomly selected from a list of 5000) or two (random upper or        +
  266. lower case) alpha characters to your passphrase.  I think there is a        +
  267. greater security exposure from all the plaintext data laying around         +
  268. during conversion.                                                          +
  269.  
  270. In version 1.3, I have given you a choice, to convert to 1.1                +
  271. passphrases, or to stay with 1.0-compatible ones.  You make your            +
  272. selection through an environment variable:                                  +
  273.  
  274.   SET SD10CMP=Y | X                                                         +
  275.  
  276. where "|" denotes a selection of either Y or X.                             +
  277.  
  278. "Y" (Yes) means that CRYPTDSK will always encrypt with Version 1.0,         +
  279. but that CRYPTDSK and LOGIN will decrypt disks encrypted with any           +
  280. version.  Note that for this double-compatibility feature to work with      +
  281. diskettes, you have to let LOGIN /F verify the passphrase with the          +
  282. encrypted diskette you want to access.
  283.  
  284. "X" (exclusive) means that CRYPTDSK and LOGIN will ALWAYS encrypt and       +
  285. decrypt with version 1.0-compatible passphrases. You will generally         +
  286. not be able to access any disks encrypted with Version 1.1 (or Version      +
  287. 1.3 with compatibility mode off).                                           +
  288.  
  289. The reason I provided eXclusive mode is so that if you know you will        +
  290. be dealing only with version 1.0-compatible disks, you can avoid the        +
  291. delay of checking for 1.1-compatible disks when you inadvertantly           +
  292. enter an incorrect passphrase.                                              +
  293.  
  294. If SD10CMP is set to anything else, or not set at all, then CRYPTDSK        +
  295. will always encrypt in 1.1-compatible mode. LOGIN and CRYPTDSK will         +
  296. decrypt disks encrypted in either mode.  (It takes an insignificant         +
  297. amount of additional time to check for a 1.0 passphrase).                   +
  298.  
  299. Keys taken from SECTSR which are verified by decryption could have          +
  300. been generated in either 1.0 or 1.1-compatible mode.  The keys              +
  301. internal to SECTSR have already been digested from the passphrase.          +
  302. These can be used by LOGIN and CRYPTDSK to encrypt and decrypt, but         +
  303. the original passphrase itself cannot be recovered and an internal key      +
  304. cannot be converted from one compatibility to another.  A flag is kept      +
  305. in SECTSR indicating which mode was used to convert the passphrase to       +
  306. the key, though, and CRYPTDSK will not allow internal keys to be used       +
  307. to encrypt in the wrong mode.                                               +
  308.  
  309. In version 1.3, the "(C)hange passphrase" feature can be used to            +
  310. convert disks encrypted in one compatibility to disks encrypted in the      +
  311. other (as specified by SD10CMP). You can even convert from one              +
  312. compatibility to the other and retain the same passphrase (but              +
  313. different keys).  Note that you can't convert compatibiities if             +
  314.  
  315.   SD10CMP=X                                                                 +
  316.  
  317. because this will prevent CRYPTDSK from decrypting (first half of           +
  318. converting) 1.1-compatible disks.                                           +
  319.  
  320. Also, CRYPTDSK 1.3 will check for and not allow a wasted pass of            +
  321. decrypting and re-encrypting to the same -key- (both passphrase and         +
  322. compatibility mode the same).                                               +
  323.  
  324. Version 1.3 has added a lot of user messages to keep you informed of        +
  325. which compatibility is being used, where passphrases are coming from,       +
  326. etc.                                                                        +
  327.  
  328. Detailed instructions:
  329.  
  330. Creating an encrypted floppy disk:
  331.  
  332. Insert any DOS-formatted floppy disk. The disk may contain data, or it may
  333. be empty. Run CRYPTDSK. Select the floppy drive, and enter a passphrase. You
  334. will be required to enter the passphrase twice to confirm. CRYPTDSK will now
  335. encrypt the disk.
  336.  
  337. As of version 1.2, if PGPPASS is set before you run CRYPTDSK, CRYPTDSK will |
  338. ask to use the value of PGPPASS for the passphrase before prompting you.    |
  339. Obviously, if you encrypt a lot of diskettes at once, this feature can save |
  340. you a lot of typing.                                                        |
  341.  
  342. As of version 1.3, if CRYPTDSK is run with SECTSR resident, you may         +
  343. be asked if you want to use the hard disk or floppy passwords               +
  344. previously entered and currently in use to encrypt another floppy.          +
  345.  
  346. Accessing an encrypted floppy disk:
  347.  
  348. Load SECTSR, if it's not already loaded. Run LOGIN /F and enter the
  349. passphrase used to encrypt the disk. The disk is now accessible. You can
  350. swap disks at any time, as long as all of the disks are encrypted with the
  351. same passphrase. You can also access unencrypted disks; SECTSR switches on
  352. and off automatically. If you want to access a disk encrypted with a
  353. different passphrase, type LOGIN /F again and enter the new passphrase. The
  354. same passphrase applies to both floppy drives.
  355.  
  356. As of version 1.3, LOGIN /F will try (if you let it read an encrypted       +
  357. diskette) the currently active hard disk passphrase (if one exists).        +
  358. If you bypass the verification step, then you are asked if you want to      +
  359. use the hard disk passphrase without verification.                          +
  360.  
  361. Decrypting a floppy disk:
  362.  
  363. Run CRYPTDSK. Select the floppy drive. CRYPTDSK will detect that the disk is
  364. encrypted, and will prompt you to decrypt it. Enter your passphrase.
  365. CRYPTDSK will now decrypt the disk.
  366.  
  367. As of version 1.2, if PGPPASS is set before you run CRYPTDSK, CRYPTDSK will |
  368. try the value of PGPPASS for the passphrase before prompting you.           |
  369.  
  370. As of version 1.3, CRYPTDSK will also try the active hard disk and          +
  371. floppy passphrases in SECTSR before prompting you.                          +
  372.  
  373. Creating an encrypted hard drive partition:
  374.  
  375. You must have more than one partition, or more than one hard drive. If you
  376. encrypt your C: drive, you will not be able to boot from it! If this
  377. happens, decrypt it again to restore it. You should create a small D:
  378. partition, large enough to store as much sensitive information as you plan
  379. to keep on your hard drive. You can also run applications from the secure
  380. partition, but there will be some speed loss. Back up your hard drive before
  381. installing. Use FDISK to repartition your drive, and set up a small D:
  382. drive, which will become your secure partition. You can copy data to it
  383. before or after encryption. Run CRYPTDSK and select the letter of the
  384. partition you want to encrypt. CRYPTDSK will display the physical drive,
  385. head, and cylinder of the boot sector of this partition. You should verify
  386. these numbers. Then enter a passphrase to encrypt the partition. This will
  387. take a few minutes, depending on the size of the partition and your CPU.
  388.  
  389. You can also describe a partition to CRYPTDSK by its                        +
  390.  
  391.  drive,cylinder,head                                                        +
  392.  
  393. in cases where CRYPTDSK can't find the partition from the DOS disk          +
  394. letter.  This can happen in configurations with more than two physical      +
  395. disks or where special disk drivers are used.  CRYPTDSK will prompt         +
  396. for these parameters if you enter "X" when it prompts you for DOS disk      +
  397. letter.  You can use the FPART utility to scan physical drive "drive",      +
  398. which are numbers starting from zero, and locate the proper numbers         +
  399. for "cylinder" and "head".                                                  +
  400.  
  401. Note that commas (",") must be used to separate these parameters for
  402. CRYPTDSK, while blanks are used for LOGIN.
  403.  
  404. As of version 1.2, if PGPPASS is set before you run CRYPTDSK, CRYPTDSK will |
  405. ask to use the value of PGPPASS for the passphrase before prompting you.    |
  406.  
  407. Preventing damage to the secure partition, which could be caused by writing
  408. to it withot first logging in:
  409.  
  410. Load SECTSR. Run LOGIN D: /S to put the drive in safe mode. This should be
  411. done in AUTOEXEC.BAT. Writes will be locked out. A drive not ready error
  412. will occur if you attempt to access the encrypted drive. This will prevent
  413. DOS programs from reading the drive. Windows behaves rather pathologically:
  414. it retries the attempt about a dozen times, and then displays garbage. If
  415. this happens, just close the window, log in, and try again. The drive is
  416. still protected against writes in Windows.
  417.  
  418. As of version 1.3, you should add LOGIN D:  /S statement(s) to              +
  419. AUTOEXEC.BAT and load SECTSR before encrypting your hard disk               +
  420. partition(s).  CRYPTDSK will set the partition to Safe mode before          +
  421. beginning to encrypt.  (CRYPTDSK itself bypasses SECTSR).                   +
  422.  
  423. Accessing an encrypted hard drive partition:
  424.  
  425. Load SECTSR, if it's not already loaded.  Run LOGIN D:  where D is
  426. replaced by the letter of the encrypted partition.  Type the
  427. passphrase.  Your secure partition is now accessible.  Note that only
  428. one secure partition can be accessible at a time.  You can have
  429. encrypted floppies and a secure partition active simultaneously, but
  430. you can't have two secure partitions active at the same time.  The TSR      +
  431. only stores two cryptographic keys:  one for a secure partition, and
  432. one for encrypted floppies.
  433.  
  434. Although V1.3 still only allows you to have one secure partition            +
  435. active, up to four may be placed in Safe mode. Each partition may be        +
  436. encrypted with a different passphrase, allowing up to four different        +
  437. users (or groups) to keep data private from each other.                     +
  438.  
  439. Decrypting a hard drive partition:
  440.  
  441. As of version 1.3, it is no longer necessary or desireable to reboot        +
  442. to clear SECTSR out of memory. Run CRYPTDSK, select the drive letter,
  443. and enter the passphrase. CRYPTDSK will decrypt your partition.
  444.  
  445. As of version 1.2, if PGPPASS is set before you run CRYPTDSK, CRYPTDSK will |
  446. try the value of PGPPASS for the passphrase before prompting you.           |
  447.  
  448. Changing a passphrase:
  449.  
  450. Versions 1.1 and 1.3 allow you to do this in one step.  Select the          +
  451. drive with CRYPTDSK and it will prompt you to change the passphrase.
  452. Enter the old and new passphrases as prompted.  Decrypt the disk with
  453. the old passphrase, and re-encrypt it with the new passphrase.
  454.  
  455. This is more secure than doing decryption and encryption separately.
  456. Decryption and re-encryption is done a track at a time. The
  457. intermediate plaintext exists only in memory, never on the disk.
  458.  
  459. Version 1.3 includes the additional testing for PGPPASS and SECTSR          +
  460. internal passphrases for decryption and the additional prompting for        +
  461. new passphrases discussed above.                                            +
  462.  
  463. Clearing keys:
  464.  
  465. Typing LOGIN /C will erase the cryptographic keys from memory and disable
  466. encryption. You may then run LOGIN again to restore access. Note that this
  467. does not erase plaintext from memory; turn the computer off to do this.
  468.  
  469. As of Version 1.2, typing LOGIN /C /PGP will clear the SecureDrive crypto   |
  470. keys from memory AND clear the PGPPASS environment variable. This is done   |
  471. in a manner less likely to leave your passphrase in memory than just using  |
  472. the DOS SET command.  In addition, Version 1.2 clears all the free memory   |
  473. it can find, which is likely to include some plaintext.  However, if you    |
  474. want to be absolutely sure all traces of sensitive data are erased from     |
  475. memory then turning off the computer is still recommended.                  |
  476.  
  477. Using a disk cache:
  478.  
  479. You can use a disk cache such as SMARTDRV.EXE or NCACHE to speed up access.
  480. The cache must be loaded after SECTSR is loaded. A .SYS cache will not work,
  481. because it is loaded before the TSR. If the cache is loaded first, it will
  482. cache ciphertext and provide little speedup. If the cache is loaded after
  483. SECTSR, it will cache plaintext and speed up access.
  484.  
  485. Hazards to avoid:
  486.  
  487. Writing to the encrypted partition or encrypted floppies without logging in.
  488. When you load the TSR and put it in safe mode, writes will be locked out.
  489. However, if you access an encrypted disk without loading the TSR, the disk
  490. can be destroyed. This happened to one of the beta testers. Use safe mode
  491. and load the TSR in AUTOEXEC to prevent it.
  492.  
  493. Forgetting your passphrase. With any lock, there is the hazard of losing the
  494. key. But cryptography is a special case because there are no locksmiths to
  495. save you. If you forget a passphrase, you're out of luck. That data is gone.
  496.  
  497. Using this program without backups.  It accesses disks at the low level of
  498. the BIOS, and a program bug or an unfriendly interaction between the TSR
  499. and an application could scramble your hard drive permanently.
  500.  
  501. Exporting this program.  Cryptography is export controlled, and             |
  502. sending this program outside the country may be illegal.  Don't do it.
  503.  
  504. The "author" of versions 1.2 and 1.3, Edgar Swank, says that the            +
  505. export ban should not prevent you from placing this program on public       |
  506. BBS's and anonymous FTP sites in the US and Canada.  If individuals         |
  507. outside the US/Canada use the internet or international long distance       |
  508. to obtain copies of the program, THEY may be breaking US law.               |
  509.  
  510. Any such foreign individuals should be aware that US law enforcement may    |
  511. legally (under US law) apprehend individuals who break US laws even if such |
  512. individuals are not on or even have never been on US soil.  Such            |
  513. apprehension may remove such individuals directly to US jurisdiction        |
  514. without benefit of extradition proceedings in such individuals' home        |
  515. country(ies).  This has actually happened in at least two cases, Mexico --  |
  516. suspect in murder of US drug agent, Panama -- Noriega -- indicted in        |
  517. absencia for drug smuggling.  As is well known, after a small war with      |
  518. Panama, Noriega was brought to the USA, tried and convicted.  He is now a   |
  519. guest of the US Government in a Florida prison.                             |
  520.  
  521. Potential security problems:
  522.  
  523. Data leaks: swapfiles and temporary files. Many application programs create
  524. swapfiles and temporary files all the time. If these files are written to a
  525. non-encrypted disk, they will expose your data. This can be avoided by
  526. putting the swapfiles and temporary files on the encrypted disk, but this is
  527. slow. The best solution is to use a RAM disk or cache the encrypted disk.
  528. There are also programs such as Norton WIPEINFO which will wipe empty space.
  529.  
  530. Trojans and viruses: someone could replace LOGIN with a hacked version, or
  531. install a specially written Trojan on your system, and capture your
  532. passphrase or key. Since the key remains in memory in the TSR, any program
  533. could potentially swipe it. The only sure way to prevent this is to make
  534. sure that nobody has the opportunity to install such a Trojan.
  535.  
  536. If you have PGP, you can verify that version 1.3d executable modules        +
  537.  
  538.   CRYPTDSK.EXE                                                              |
  539.   LOGIN.EXE                                                                 |
  540.   SECTSR.COM                                                                |
  541.   FPART.EXE                                                                 +
  542.  
  543. have not been modified since I compiled them by checking them against       |
  544. the detached signatures included. First add my (Edgar Swank's) public key   |
  545. to your public keyring
  546.  
  547.   PGP -ka KEY.ASC                                                           |
  548.  
  549. Then issue commands                                                         |
  550.  
  551.   PGP CRYPTDSK.SIG  CRYPTDSK.EXE                                            |
  552.   PGP LOGIN.SIG     LOGIN.EXE                                               |
  553.   PGP SECTSR.SIG    SECTSR.COM                                              |
  554.   PGP FPART.SIG     FPART.COM                                               +
  555.  
  556. The integrity of this check depends upon that my public key is genuine. You |
  557. should satisfy yourself from the signatures on the key. Also my public key  |
  558. is available independently on various public keyservers.                    |
  559.  
  560. Passphrase guessing: if your passphrase is weak (a single word, monocase,
  561. with no punctuation is very weak) an attacker could try to guess it. This
  562. has proven highly effective against Unix login passwords.  The best
  563. passphrase is a phrase of five or more words which does not appear in       +
  564. text or literature.
  565.  
  566. How many passphrases?: The additions to version 1.2 make it easier to use a |
  567. single passphrase both for your PGP secret key and for SecureDrive hard and |
  568. floppy disks. If you do this, it's obviously putting all your eggs in one   |
  569. basket. One school of thought says its better to use several baskets, so if |
  570. one breaks you only loose some of your eggs.  The other school says it may  |
  571. be better to use one basket IF you make it the best damn basket you can and |
  572. put your best efforts into protecting it.                                   |
  573.  
  574. So if you use a single passphrase for everything, make it the best          |
  575. passphrase you can think of and REMEMBER without writing it down ANYWHERE.  |
  576. A good passphrase should be at least five or six words.  The easiest to     +
  577. remember and hardest to guess will be "outrageous" and use words that       |
  578. normally don't go together, e.g.  "red grass over yellow sky" (don't use    |
  579. this example).  Some use of profanity, foreign words, and creative spelling |
  580. and punctuation, as long as you can remember it all, will also make the     |
  581. passphrase harder to guess.                                                 |
  582.  
  583. Backups:                                                                    +
  584.                                                                             +
  585. It will defeat the effect of having encrypted hard disk partition if        +
  586. you have unencrypted backups.  Backups must also be encrypted with the      +
  587. same strength cypher as the hard disk.                                      +
  588.                                                                             +
  589. If you don't have tape backup, you can use SecureDrive encrypted disks      +
  590. for backup. Be sure to test your backup program to make sure both           +
  591. backup -and- restore functions work with SecureDrive. PKZIP and some        +
  592. other compression programs work well with SecureDrive and are able to       +
  593. backup to multiple diskettes, backup an entire volume, or only files        +
  594. with the archive flag on, etc.                                              +
  595.                                                                             +
  596. If you have a large amount of encrypted data, and you do have tape          +
  597. backup, it will be a pain to have to use diskettes for the encrypted        +
  598. data. The problem is that existing tape backup programs do not offer        +
  599. strong encryption. (beware of programs that offer "password                 +
  600. protection"; this is weak or even non-existant encryption, easily           +
  601. broken) They also work only with DOS files. One solution is to use          +
  602. the device driver                                                           +
  603.                                                                             +
  604. RAWDRV11.ZIP     9029  09-29-93  Device Driver maps range of cyls.          +
  605.                                  to virtual file. Useful with               +
  606.                                  tape backups.                              +
  607.                                                                             +
  608. It's available via FTP at                                                   +
  609.                                                                             +
  610.    ftp.uni-duisburg.de: /pub/pc/misc/rawdsk11.zip                           +
  611.                                                                             +
  612. which is the home of the author                                             +
  613.                                                                             +
  614.    Juergen Prang           |     prang@du9ds4.fb9dv.uni-duisburg.de         +
  615.    University of Duisburg  |********************************************    +
  616.    Electrical Engineering  |                                                +
  617.    Dept. of Dataprocessing |                                                +
  618.                                                                             +
  619. I have tried it out and it works.  It's not terribly user-friendly,         +
  620. so proceed carefully until you're familiar with it.  When you're first      +
  621. trying it out, I recommend you have an -independent- backup of your         +
  622. data that you know works until you have tested both backup and restore      +
  623. using this program.  The best feature of this method is that since it       +
  624. stores a disk image of the encrypted disk on tape, the encryption is        +
  625. the same as on disk, and so just as secure. As on disk, both filenames      +
  626. and file data are encrypted.  The drawbacks are that since you are          +
  627. storing encrypted data you will not get any compression, even if the        +
  628. tape backup program claims to offer compression.  Also, unless you          +
  629. VERY CAREFULLY specify an end-cylinder limit to RAWDISK, you will back      +
  630. up the entire encrypted partition, even that part which doesn't             +
  631. contain any files. There is also no way to do an incremental backup         +
  632. (only files with archive flag on) with RAWDISK.                             +
  633.                                                                             +
  634. Here are some points to using RAWDISK backup/restore.                       +
  635.                                                                             +
  636. Make up temporary replacements for AUTOEXEC.BAT and CONFIG.SYS. LOGIN       +
  637. will report the parameters you need for the RAWDISK DEVICE= statement.      +
  638. parameters needed for the DEVICE= statement, except for "end cylinder"      +
  639. which you must compute by adding the start cylinder to the size of the      +
  640. partition in cylinders minus one.                                           +
  641.                                                                             +
  642. You can't access an encrypted disk set to safe mode through RAWDISK.        +
  643. You must omit the LOGIN /S from your temporary AUTOEXEC.BAT. You can        +
  644. still provide some protection for the encrypted disk using the DOS          +
  645. ASSIGN command.  If you activate your encrypted disk partition,             +
  646. RAWDISK will access plaintext data; this can be useful, but DO NOT          +
  647. run your tape backup or restore in this mode.                               +
  648.                                                                             +
  649. If you don't want to backup a lot of unused space, you can try the          +
  650. following VERY CAREFULLY.                                                   +
  651.                                                                             +
  652. With the encrypted disk activated,                                          +
  653.                                                                             +
  654. 1)Used a disk defragmenter like DOGxxx to collect all the free space        +
  655. at the high end of the partition.                                           +
  656.                                                                             +
  657. 2)Use a filldisk utility like Norton FD to overwrite all the free           +
  658. space with a recognizable ASCII string.                                     +
  659.                                                                             +
  660. 3)Compute an approximate end cylinder bound to include only a small         +
  661. amount of the free space. Start with the free space shown by CHKDSK         +
  662. and compute the size of the free space in cylinders                         +
  663.                                                                             +
  664.   (free space in bytes)/(bytes per sector)/(sectors per                     +
  665.    head)/( heads per cylinder)                                              +
  666.                                                                             +
  667. Discard any fractional cylinders from the above and subtract from the       +
  668. previously computed end cylinder for the whole partition.  If there         +
  669. are no fractional cylinders, subtract 1 whole cylinder.  Replace the        +
  670. previous end cylinder value in the RAWDISK DEVICE= statement.               +
  671.                                                                             +
  672. 4)Re-boot with SECTSR installed and the encrypted disk activated.           +
  673. Then use a disk viewing utility like SHOWFAT on the RAWDISK disk to         +
  674. verify that recognizable free space is at the end of the RAWDISK.DAT        +
  675. file.  This is to verify that you really are backing up all the file        +
  676. data.                                                                       +
  677.                                                                             +
  678. 5)Re-boot again, this time without either activating the encrypted          +
  679. disk or placing it in safe mode.  You can still "protect" the               +
  680. encrypted disk with ASSIGN.                                                 +
  681.                                                                             +
  682. This ends the optional procedure to minimize backup size.                   +
  683.                                                                             +
  684. Before calling the tape backup program. Use a file viewing utility          +
  685. to look at the RAWDISK.DAT file on the RAWDISK disk to verify that you      +
  686. are accessing encrypted (random-looking) data.                              +
  687.                                                                             +
  688. Use your tape backup program to backup the RAWDISK.DAT file to tape.        +
  689.                                                                             +
  690. Restore your original "production" AUTOEXEC.BAT and CONFIG.SYS and          +
  691. re-boot.                                                                    +
  692.                                                                             +
  693. If you want to use this backup method in conjunction with incremental       +
  694. backups to encrypted diskettes, then before changing any files on the       +
  695. encrypted diskette, activate it and turn off all the Archive flags          +
  696. with a utility like ATTR.                                                   +
  697.                                                                             +
  698. As I said above, the first time you use this method, you want to test       +
  699. restoring from tape through RAWDISK before you rely on this method,         +
  700. having some independent backup handy, perhaps a (temporary) tape            +
  701. backup of the plaintext files.                                              +
  702.                                                                             +
  703. To restore from RAWDISK, use the same temporary AUTOEXEC.BAT and            +
  704. CONFIG.SYS files you used for backup. Especially the RAWDISK DEVICE=        +
  705. statement must be the same as was used for backup.                          +
  706.                                                                             +
  707. Again, boot with the encrypted disk neither activated nor in safe           +
  708. mode.                                                                       +
  709.                                                                             +
  710. Set VERIFY OFF.  RAWDISK does not support DOS Verify. Use a utility         +
  711. like ATTR to turn off the Read-only flag and then use the DOS DEL           +
  712. command to delete file RAWDISK.SYS from the RAWDISK disk.                   +
  713.                                                                             +
  714. Use your tape restore program to restore file RAWDISK.DAT.                  +
  715. When I tried this with my Conner "Exec" Restore, it refused to work! I      +
  716. was able to do the restore using the Conner "Basic" Restore which came      +
  717. with the tape drive. This illustrates the importance of testing the         +
  718. entire backup/restore procedure before relying on it!                       +
  719.                                                                             +
  720. Restore your original AUTOEXEC.BAT and CONFIG.SYS and re-boot.              +
  721.                                                                             +
  722. If you have any incremental diskette backups done after the tape            +
  723. backup, activate the encrypted disk and restore from those.                 +
  724.                                                                             +
  725. CAUTION: the RAWDISK.DAT file includes the partition definition             +
  726. records. DO NOT restore from a RAWDISK backup IF you have used FDISK        +
  727. to change the partition size since the backup was taken.  Obviously         +
  728. this means this method is not suited to temporarily backing up the          +
  729. encrypted partition before changing the partition size!! (When you          +
  730. restore, you will have your old partition size back!)                       +
  731.                                                                             +
  732. Rather in this case use a temporary plaintext backup. As soon as you        +
  733. don't need the plaintext backup, be sure to use the "Secure Erase" or       +
  734. "Format" function of your tape backup program on the tape so as not to      +
  735. leave any plaintext copies of your encrypted data lying around!             +
  736.                                                                             +
  737. Another possible backup procedure:                                          +
  738.                                                                             +
  739. If you have plenty of unencrypted disk space, you can use a strongly        +
  740. encrypting compression program such as HPACK to make an encrypted           +
  741. archive of data from your encrypted disk and write the resulting            +
  742. encrypted file from your unencrypted disk onto the backup tape.             +
  743.                                                                             +
  744. An alternative to HPACK is a combination of any compression program (e.g.   +
  745. PKZIP) and PGP. But DON'T rely on the "built-in" encryption of any          +
  746. compression program other than HPACK.                                       +
  747.                                                                             +
  748. The benefit of this method is you get the benefit of compression and        +
  749. only backing up file data (not free space).  It's also well suited to       +
  750. incremental backups if the archive program supports them.  The main         +
  751. drawbacks are that preparing the encrypted archive may take a lot of        +
  752. time; during some of that time your data may be exposed in plaintext.       +
  753. Also you may need up to three times the unencrypted disk space as is        +
  754. used by the encrypted files you're backing up.                              +
  755.                                                                             +
  756. WARNING: PGP sometimes does not give you an error message if it runs        +
  757. out of disk space while encrypting a large file. Always check that the      +
  758. encrypted file is at least as large as the plaintext (e.g. PKZIP )          +
  759. file.  Use the PGP Wipe (-w) function to securely erase any plaintext       +
  760. copies of your confidential data.                                           +
  761.  
  762.  
  763. CheckWord Offset:                                                           +
  764.                                                                             +
  765. Versions of SecureDrive from versions 1.0 to 1.3a have used the 8-byte      +
  766. SYSTEM ID at offset 3 of boot records of encrypted disks to store a         +
  767. "CryptFlag".  The first four bytes contain "CRYP" to denote an              +
  768. encrypted disk; the last four characters (offset 7) store a 4-byte          +
  769. checkword used to verify that the correct passphrase had been entered.      +
  770. This checkword is an MD5 digest of the IDEA key and (in Version 1.1)        +
  771. the passphrase.  The 128-bit IDEA key is an MD5 digest (iterated in         +
  772. Version 1.1) of the passphrase.  The checkword is calculated and            +
  773. stored in the boot sector when the disk partition or diskette is first      +
  774. encrypted.  Whevever you enter a passphrase to decrypt or activate the      +
  775. disk, both the key and the checkword are generated.  The checkword is       +
  776. compared against the one stored in the boot record as a check that the      +
  777. same passphrase was entered for decryption as for encryption.  Note         +
  778. that the boot sector is never itself encrypted.  Also note that since       +
  779. MD5 is a "cryptographicly strong" one-way digest function, it is not        +
  780. computationally feasible to find the IDEA key, much less the original       +
  781. passphrase, from the checkword.                                             +
  782.                                                                             +
  783. In hindsight, this was not the best choice of a place for this flag.        +
  784. Apparently, some versions of MSDOS, especially those included with          +
  785. some laptop PC clones, insist that the SYSTEM ID field of the boot          +
  786. sector be ASCII characters, which the checkword is not. Also, the           +
  787. new diskette formatting utility from Spain, 2M/2MF, uses all the            +
  788. SYSTEM ID field for its own purposes.  For this reason, the location        +
  789. of the CryptFlag has been move from SYSTEM ID (offset 3) to offset          +
  790. 802 of boot records, as of SecureDrive Release 1.3d.  Release 1.3d          +
  791. is upward compatible with previous releases; that is, Release 1.3d can      +
  792. activate (LOGIN), decrypt, or change passphrases (CRYPTDSK) of disks        +
  793. encrypted with SecureDrive Releases 1.3a or before; but you cannot use      +
  794. previous releases of SecureDrive (except 1.3c) on disks encrypted by        +
  795. 1.3d.                                                                       +
  796.                                                                             +
  797. You can convert disks encrypted by previous versions of SecureDrive to      +
  798. the new standard CryptFlag offset by using the /UCFO [Update CryptFlag      +
  799. Offset] function with LOGIN (either for hard disk partitions or             +
  800. diskettes).  Note that /UCFO will overlay SYSTEM ID (the old                +
  801. CryptFlag) with "MSDOS   ", which means that that disk can no longer        +
  802. be activated or decrypted with previous versions of SecureDrive.            +
  803.                                                                             +
  804. /UCFO doesn't work if combined with the /S (safe mode) parameter.           +
  805.                                                                             +
  806. Changing a disk's password with CRYPTDSK will also update the               +
  807. CryptFlag offset.                                                           +
  808.                                                                             +
  809. ATTENTION: Version 1.3b users.                                              +
  810.                                                                             +
  811. See file BUGS13A.DOC for instructions.                                      +
  812.  
  813.  
  814. Reconstructing a CheckWord:                                                 +
  815.                                                                             +
  816. After using some disk repair utility LOGIN and CRYPTDSK may always          +
  817. say you have entered an incorrect passphrase for your encrypted disk,       +
  818. even when you're SURE you used the right passphrase. Or LOGIN and           +
  819. CRYPTDSK may say a disk is unencrypted when it obviously is encrypted.      +
  820.                                                                             +
  821. Mike had a report from a user who used some disk utility that re-wrote      +
  822. his boot record, overlaying the checkword (but apparently not the           +
  823. "CRYPT" flag).  This is probably a different manifestation of the           +
  824. problem described above.  This disk-fixing utility wants to see an          +
  825. all-ASCII SYSTEM ID and will set ASCII where it doesn't find it.            +
  826.                                                                             +
  827. You can fix this by using the /RCF [Recover CryptFlag] parameter to         +
  828. LOGIN.  This will allow you to activate a disk even if the "CRYP" flag      +
  829. has been overwritten or the checkword doesn't match.  You will be           +
  830. asked to enter the passphrase twice.  The new checkword will be             +
  831. written at new standard offset 506 which will hopefully avoid a             +
  832. repetition of the problem the next time you use that same utility.          +
  833.                                                                             +
  834. You are not allowed to recover the CheckWord if SD10CMP=X, since            +
  835. this setting does now allow LOGIN to compute or check version 1.1           +
  836. compatible checkwords.                                                      +
  837.                                                                             +
  838. Also, if after you enter the checkword, you get garbage when trying         +
  839. to read the disk, change SD10CMP from Y to N (or vice versa) and try        +
  840. LOGIN xxx  /RCF again.                                                      +
  841.                                                                             +
  842. /RCF also doesn't work if combined with the /S (safe mode) parameter.       +
  843.                                                                             +
  844. Note that extreme caution is required when using this parameter. If         +
  845. you force activation of a disk with the wrong passphrase, it's              +
  846. effectively the same as accessing the disk without SECTSR loaded.  Any      +
  847. write to the disk would likely make -all- data on the disk partition        +
  848. or diskette unreadable.                                                     +
  849.  
  850. Placement of SECTSR:                                                        +
  851.                                                                             +
  852. If you encounter a problem that CRYPTDSK (and FPART) don't work while       +
  853. SECTSR is installed, try re-ordering device drivers & TSR's which           +
  854. might effect diskette access.  Note that CRYPTDSK/FPART will reach          +
  855. below SECTSR to do sector disk I/O, so any TSR's loaded after SECTSR        +
  856. will also be bypassed by CRYPTDSK/FPART.                                    +
  857.                                                                             +
  858. In general, TSR's which assist in reading non-standard formatted            +
  859. diskettes, such as FDREAD.EXE and 2M.COM, should be loaded BEFORE           +
  860. SECTSR.                                                                     +
  861.  
  862. CRYPTDSK and FPART may be used without SECTSR loaded if necessary.          +
  863.  
  864. Running under Windows:
  865.  
  866. I have been able to get LOGIN to activate disks in a Windows DOS
  867. window. However LOGIN /PGP and its variants do not set PGPPASS. SET
  868. doesn't work either.
  869.  
  870. It's probably better to call LOGIN in your AUTOEXEC for Windows, if
  871. possible, and get your disk logged in before loading Windows.
  872.  
  873. I have been able to start CRYPTDSK in the DOS window and it ran fine.
  874. But if I switched to another window, it crashed in the middle. I don't
  875. see how this can be anything but a Windows problem.  Since crashing
  876. CRYPTDSK in the middle essentially destroys all the data on the disk,
  877. I don't recommend trying to run CRYPTDSK under Windows.
  878.  
  879. Of course, SECTSR must be loaded before Windows. DON'T load SECTSR in
  880. a DOS Window.
  881.  
  882. Using SecureDrive with non-standard Diskette Formatting Programs            +
  883.                                                                             +
  884. Of course SecureDrive works with diskettes formatted with DOS FORMAT,       +
  885. but many PC users use non-standard formatting programs (and supporting      +
  886. TSR's) to store more data on a diskette than allowed by the standard        +
  887. FORMAT program.                                                             +
  888.                                                                             +
  889. One such program, FDFORMAT, with TSR FDREAD.EXE, originated in              +
  890. Germany.  The last version (FDFORM18.ZIP) was released in 1991.             +
  891. FDFORMAT allows, for example, storage of up to 820 Kilobytes of data        +
  892. on cheap DSDD diskettes (360 Kilobytes with DOS FORMAT).  All Releases      +
  893. of SecureDrive are compatible with FDFORMAT, provided only that             +
  894. SECTSR.COM is loaded -after- FDREAD.EXE.                                    +
  895.                                                                             +
  896. Another program, 2MF, with TSR 2M.COM, has recently been released from      +
  897. Spain as 2M13.ZIP.  This program claims to either provide higher            +
  898. storage capacities (902 Kilobytes) or improved access times relative        +
  899. to FDFORMAT.  However, 2M recognizes diskettes formatted by 2MF via         +
  900. the SYSTEM ID field in the diskette's boot record; Before Release           +
  901. 1.3c, SecureDrive also used the SYSTEM ID field to test for an              +
  902. encrypted diskette and check for a valid passphrase.  1.3c still had        +
  903. some problems working with 2MF/2M, so 2MF cannot be used with               +
  904. SecureDrive Releases before 1.3d with encrypted diskettes.                  +
  905.                                                                             +
  906. Version 1.3d also adds other changes for compatibility with 2M13.           +
  907.                                                                             +
  908. 1)Adjust decryption to allow for simulation of FAT2 by reading FAT1.        +
  909. One of the cryptography parameters used by SecureDrive depends on           +
  910. sector address. Using a FAT2 address to decrypt FAT1 data would lead        +
  911. to incorrect decryption. 1.3d adjusts this parameter for FAT2 sectors       +
  912. on 2M-formatted diskettes.                                                  +
  913.                                                                             +
  914. 2)2M13 also (incorrectly) moves data to user buffers on a write             +
  915. verify.  This would place encrypted data in user buffers.  Version          +
  916. 1.3d works around this by treating write verifys the same as writes,        +
  917. encrypting the buffer before the write verify and decrypting after,         +
  918. which apparently provides a solution.                                       +
  919.                                                                             +
  920. 2M13 code which causes this problem also frequently causes requests         +
  921. for write verify not to be performed, which could leave unreadable          +
  922. data undected until a later time.  See below for a recommended source       +
  923. change to 2M13.                                                             +
  924.                                                                             +
  925. If you want to switch between FDFORMAT and 2M diskettes, you must load      +
  926. both FDREAD.EXE and 2M.COM -before- SECTSR.COM.  Fortunately, FDREAD        +
  927. and 2M will both load themselves high, and SECTSR can be loaded high        +
  928. with LOADHI.                                                                +
  929.  
  930. Source code and modifications:
  931.  
  932. SECTSR.ASM is the self-contained source for SECTSR. Use TASM and TLINK /T to
  933. assemble it.
  934.  
  935. CRYPTDSK uses SDCOMMON and CRYPT2.OBJ generated from CRYPT2.ASM. It also
  936. uses MD5.C, which is from the PGP23A source code.
  937.  
  938. LOGIN uses SDCOMMON and MD5.C.
  939.  
  940. In version 1.2, LOGIN also uses SETENV.OBJ generated from SETENV.ASM. This  |
  941. code is used to set/clear the PGPPASS environment variable. This code sets  |
  942. the enviornment variable in all copies of the environment it can find, so   |
  943. it may work in some situations where the DOS SET command does not. On the   |
  944. other hand, in some early versions of DOS, it may not find the master       |
  945. environment area. Experiment for yourself.                                  |
  946.  
  947. Version 1.3 adds the RLDBIOS.ASM module which replaces the C++ library      +
  948. subroutine BIOSDISK and allows LOGIN, CRYPTDSK, and FPART to access         +
  949. the "real" BIOS without going through SECTSR.                               +
  950.  
  951. The programs were compiled with Turbo C++. Compile them large model.
  952.  
  953. In versions 1.2 and 1.3d a MAKEFILE is provided.
  954.  
  955. If you make any interesting modifications or improvements, send us
  956. (Edgar and Mike) mail and a copy of the new code.  We hope this
  957. program will become popular and will be modified and improved by the
  958. net.
  959.  
  960. If you have 2M13SRC.ZIP (source code for 2M13), I recommend the             +
  961. following change to 2M.ASM                                                  +
  962.  
  963. acceso_secc:   PUSH  AX
  964.                CMP   orden,F_WRITE     ; acabar transferencia sector
  965.                JE    escritura
  966.                CMP   orden,F_VERIFY    ;                               EWS
  967.                JE    VERIFY            ;                               EWS
  968.                CALL  leido?            ; realizar lectura...
  969.                JNC   ya_leido          ; sector ya en el buffer
  970. hay_que_leer:  CALL  acceso_sector     ; efectuar E/S
  971.                JC    acc_ret           ; ha habido fallo
  972. ya_leido:      CALL  trans_secc        ; buffer -> memoria
  973.                JMP   acc_ret
  974. escritura:     CMP   seccion,0
  975.                JNE   prelectura        ; solo parte del sector cambia
  976.                CALL  num_secciones
  977.                CMP   secciones,AL
  978.                JAE   escribir          ; Todo el sector fisico cambia
  979. prelectura:    CALL  leido?            ; Leer el sector fisico para
  980.                JNC   escribir          ; cambiar solo una parte de el
  981.                MOV   orden,F_READ      ; de momento leer...
  982.                CALL  acceso_sector     ; efectuar E/S
  983.                MOV   orden,F_WRITE     ; ... restaurar orden original
  984.                JC    acc_ret           ; ha habido fallo
  985. escribir:      CALL  trans_secc        ; memoria -> buffer
  986.                CALL  acceso_sector     ; volcar buffer al disco
  987.                jmp   acc_ret                                       ;EWS
  988. VERIFY:                                                            ;EWS
  989.                CALL  acceso_sector     ; volcar buffer al disco    ;EWS
  990.                JC    acc_ret                                       ;EWS
  991. ;The following section just increments DI and decrements           ;EWS
  992. ;secciones in imitation of trans_secc, but with no actual          ;EWS
  993. ;data-transfer either way                                          ;EWS
  994.                PUSH  BX                                            ;EWS
  995.                MOV   BL,seccion        ; desde esta seccion        ;EWS
  996.                CALL  num_secciones     ; n* secciones del sector   ;EWS
  997. VERIFY01:                                                          ;EWS
  998.                ADD   DI,512                                        ;EWS
  999.                DEC   secciones         ; una menos                 ;EWS
  1000.                JZ    VERIFY02                                      ;EWS
  1001.                INC   BX                ; otra seccion del sector   ;EWS
  1002.                CMP   BL,AL             ; ?sector agotado?          ;EWS
  1003.                JB    VERIFY01          ; aun no                    ;EWS
  1004. VERIFY02:                                                          ;EWS
  1005.                POP   BX                                            ;EWS
  1006. acc_ret:       PUSHF
  1007.                INC   sector            ; preparado para otro sector
  1008.                MOV   seccion,0         ; desde su primera seccion
  1009.                POPF
  1010.                POP   AX
  1011.                RET
  1012.  
  1013. [Add statements marked "EWS" where indicated].  This should correct         +
  1014. the handling of write verifies.  Once you have made this change, you        +
  1015. can change SECTSR.ASM as follows:                                           +
  1016.  
  1017. ;DECIDE IF THIS REQUEST NEEDS PROCESSING
  1018.  CMP AH,2 ;READ SECTOR
  1019.  JE RDORWR
  1020.  CMP AH,3 ;WRITE SECTOR
  1021.  JE RDORWR
  1022.  CMP AH,4 ;WRITE VERIFY            <------------- Remove or comment out
  1023.  JE RDORWRC                        <-------------
  1024.  CMP AH,8 ;REQUEST FOR ADDRESS?
  1025.  JNE TONOPROC
  1026.  
  1027. This will improve performance by stopping SECTSR from intercepting
  1028. write verifies and doing an encryption and decryption of the data
  1029. area.
  1030.  
  1031. Miscellaneous:
  1032.  
  1033. Version 1.3 CRYPTDSK now exits gracefully if an attempt is made to          +
  1034. write to a write-protected diskette.                                        +
  1035.  
  1036. Version 1.3 SECTSR has been modified to align the internal stack and        +
  1037. some data fields. This may marginally improve performance on 16/32-bit      +
  1038. PC's.                                                                       +
  1039.  
  1040. Note that Version 1.3d CRYPTDSK, LOGIN and FPART -require- use of           +
  1041. Version 1.3d SECTSR.  Do not mix modules of different versions!             +
  1042. (But CRYPTDSK and FPART -may- be run without SECTSR loaded at all).         +
  1043.